home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1996 #6
/
Amiga Plus CD - 1996 - No. 06.iso
/
pd
/
daten
/
abook
/
arexx
/
sendmess.abx
< prev
next >
Wrap
Text File
|
1995-09-13
|
8KB
|
243 lines
/*
** $VER: sendmess.rexx 02.01ß (06.09.95) © Aris Basic
**
**
** PROGRAMNAME:
** sendmess.rexx
**
** FUNCTION:
** Sends a message via MicroDot from Address-Book (© Jörg Krause).
**
** This macro needs MicroDot 1.10 by © Oliver Wagner
** Its possible that also works with older MD but i`m not sure.
**
** $HISTORY:
**
** 28.12.94 : 01.12 : initial release
** 12.01.95 : 01.15 : subject can have now spaces(thes will be converted TO underline "_")
** 12.01.95 : 01.20 : problems with path "Ram Disk" are now gone this path will be converted
** "RAM".Editor it`s now user will it must not be ED.Added Support
** FOR uuencoding binar Files with user choice OF program.
** 11.02.95 : 01.50 : now script use ABook Server(1.30+) wenn needed this means that script
** must not be Started from ABook actualy he don`t need ABook because
** script will than use ABook Server.
** 02.03.95 : 01.51 : liltle bug removed (after message sending MD givs no more requests)
** 01.05.95 : 02.00 : version for ABook 0.40 Beta and (i hope) 1.00
** 06.09.95 : 02.01ß: full addapted on ABook 01.00
*/
edcmd='GED'
edsufix='STICKY SCREEN=WORKBENCH'
/*
** Editor Commands Examples:
**
** GoldED © Dietmar Eilert:
**
** edcmd='GED'
** edsufix1='STICKY' <- This Suffix must be in VAR sufix you use GoldED
** edsufix2='STICKY SCREEN=WORKBENCH' <- Suffix FOR GoldED on Workbench Screen
** change ScreenName IF you want another
** PUBLIC Screen
**
** ED © Commodore Amiga INC.:
**
** edcmd='ED '
** edsufix='' <- I don`t know any usefull Argument FOR ED
**
**
** In Script Command Actualy IS : edcmd||' T:mess.ascii '||edsufix
**
**
*/
uuencmd='UUxt a'
uuenin=' '
uuensufix=''
/*
** UUEncode Commands Examples:
**
** UUxt © Asher Feldman:
**
** uuencmd='UUxt -a'
** uuenin=' ' <- When Somebody need FOR own UUencode package
** uuensufix='' <- See UP ^
**
**
** UUencode Author ?:
**
** uuencmd='uuenode'
** uuenin=' >'
** uuensufix=''
**
**
**
**
** In Script Command Actualy IS : uuencmd||' '||file||'.uu'||uuenin||file||' '||uuensufix
**
**
*/
OPTIONS RESULTS
CR=D2C(13)
IF ~Show('P','ADDRESS_BOOK.1') THEN DO
IF ~Show('P','ABOOK_SERVER') THEN DO
SAY 'Kann Address-Book oder ABook-Server nicht finden !!'
EXIT 10
END
CALL server()
END
ADDRESS 'ADDRESS_BOOK.1'
checkMD()
'LOCKGUI'
'FIRST SELECTED'
lock=RESULT
'UNLOCKGUI'
IF lock=0 THEN CALL server()
main:
'LOCK ENTRY='lock
IF RC=10 THEN DO
'REQUESTRESPONSE PROMPT="Ungültiger Lock" TITLE="FEHLER" BUTTON="_OK"'
CALL error()
END
'QUERY STEM=DATA.'
IF DATA.EMAIL.COUNT=0 THEN CALL noemail()
IF DATA.EMAIL.COUNT>1 THEN em=morethenone()
IF DATA.EMAIL.COUNT=1 THEN em=1
email=getemail(em)
lemail=LENGTH(email)
IF lemail=0 THEN DO
'REQUESTRESPONSE PROMPT="Eintrag hat keine EMail-Adresse" TITLE="FEHLER"
BUTTON="_OK"'
CALL noemail()
END
'REQUESTRESPONSE PROMPT="Art der Nachricht" TITLE="ANFRAGE" BUTTON="_KURZ|_DATEI|_ABBRUCH"'
button=RESULT
SELECT
WHEN button=0 THEN CALL ex()
WHEN button=1 THEN DO
'REQUESTSTRING PROMPT="Nachricht:" DEFAULT="Hallo Ruf mich an!" TITLE="ANFRAGE"'
nachricht=RESULT
file='T:mess.ascii'
OPEN(tmp,file,'WRITE')
WRITELN(tmp,nachricht)
CLOSE(tmp)
filetyp=1
END
WHEN button=2 THEN DO
'REQUESTRESPONSE PROMPT="Was fuer eine Datei ?" TITLE="ANFRAGE"
BUTTON="_ALT(ASCII)|ALT(_BIN)|_NEU(ASCII)"'
button2=RESULT
IF button2=0 THEN DO
ADDRESS COMMAND edcmd||' T:mess.ascii '||edsufix
file='T:mess.ascii'
filetyp=1
END
IF button2=1 THEN DO
'REQUESTFILE TITLE="ASCII-Datei:"'
IF RC=5 THEN CALL ex()
file=RESULT
filetyp=1
file=checkram(file)
END
IF button2=2 THEN DO
'REQUESTFILE TITLE="BIN-Datei:"'
IF RC=5 THEN CALL ex()
file=RESULT
filetyp=2
file=checkram(file)
'REQUESTRESPONSE PROMPT="Sie haben eine Binaerdatei ausgewaehlt.Soll ich diese UUEncoden?" TITLE="ANFRAGE" BUTTON="_JA|_NEIN"'
button3=RESULT
IF button3=1 THEN DO
ADDRESS COMMAND uuencmd||' '||file||'.uu'||uuenin||file||' '||uuensufix
file=file||'.uu'
filetyp=1
END
END
END
OTHERWISE CALL error()
END
'REQUESTSTRING PROMPT="Betreff:" DEFAULT="Hallo" TITLE="ANFRAGE"'
betreff=RESULT
ADDRESS 'MICRODOT'
NOREQUEST
IF filetyp=1 THEN DO
SendMail TO email BODYFILE file SUBJECT SPACE(betreff,1,'_')
IF file='T:mess.ascii' THEN ADDRESS COMMAND 'Delete T:mess.ascii'
END
IF filetyp=2 THEN DO
SendMail TO email BODYFILE file BIN SUBJECT betreff
END
NOREQUEST OFF
ex:
'UNLOCK 'lock
EXIT
noemail:
'REQUESTRESPONSE PROMPT="Keine EMail in diesem Eintrag !" TITLE="FEHLER"'
error:
'UNLOCK 'lock
EXIT 10
PROCEDURE checkram:
arg filename
w1=WORD(filename,1)
IF w1='RAM' THEN DO
wl=LENGTH(filename)
ramstr='RAM'
filestr=SUBSTR(filename,9,wl-8)
filen=ramstr||filestr
RETURN filen
END
RETURN filename
EXIT 0
PROCEDURE checkMD:
IF ~Show('P','MICRODOT') THEN DO
'REQUESTRESPONSE PROMPT="Kann MicroDot nicht finden !" TITLE="FEHLER" BUTTON="_OK"'
EXIT 10
END
RETURN 0
server:
ADDRESS 'ABOOK_SERVER'
'SELECT STEM='VAR.
lock=VAR.1
CALL main()
PROCEDURE morethenone:
DO a=1 TO DATA.EMAIL.COUNT
SELECT
WHEN a=1 THEN buttons=DATA.EMAIL.1.DES
WHEN a=2 THEN buttons=buttons||DATA.EMAIL.2.DES
WHEN a=3 THEN buttons=buttons||DATA.EMAIL.3.DES
WHEN a=4 THEN buttons=buttons||DATA.EMAIL.4.DES
WHEN a=5 THEN buttons=buttons||DATA.EMAIL.5.DES
WHEN a=6 THEN buttons=buttons||DATA.EMAIL.6.DES
END
checkandadd()
END
'REQUESTRESPONSE PROMPT="Dieser Eintrag hat mehrere EMail Adressen.\nWelche soll benutzt werden?" TITLE="ANFRAGE" BUTTON='buttons
IF RESULT=0 THEN ret=DATA.EMAIL.COUNT
ELSE ret=RESULT
RETURN ret
PROCEDURE checkandadd:
IF a<DATA.EMAIL.COUNT THEN buttons=buttons||'|'
RETURN 0
PROCEDURE getemail:
ARG nm
SELECT
WHEN nm=1 THEN ret=DATA.EMAIL.1.ADR
WHEN nm=2 THEN ret=DATA.EMAIL.2.ADR
WHEN nm=3 THEN ret=DATA.EMAIL.3.ADR
WHEN nm=4 THEN ret=DATA.EMAIL.4.ADR
WHEN nm=5 THEN ret=DATA.EMAIL.5.ADR
WHEN nm=6 THEN ret=DATA.EMAIL.6.ADR
END
RETURN ret